<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2019/8/15
 * Time: 10:50
 */
namespace Modules\Logic;
class BasicLogic
{
    /**
     * 应用平台
     * @var null
     */
    protected $platform = null;
    /**
     * 版本号
     * @var null
     */
    protected $version = null;
    /**
     * 应用市场
     * @var null
     */
    protected $channel = null;
    /**
     * APP名称
     * @var null
     */
    protected $appName = null;
    /**
     * IP地址
     * @var null
     */
    protected $ip = null;
    /**
     * 设备号
     * @var null
     */
    protected $imei = null;

    /**
     * 初始化
     * BasicLogic constructor.
     */
    public function __construct()
    {
        $this->getHeader();
    }

    /**
     * 全局参数赋值
     */
    public function getHeader()
    {
        $request = app("request");
        $this->platform = $request->header("app-platform");
        $this->version = $request->header("app-version");
        $this->appName = $request->header("app-name");
        $this->channel = $request->header("app-channel");
        $this->ip = $request->getClientIp();
        $this->imei = $request->header("imei");
    }
}